package com.example.student.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.common.domain.pojo.StudentAnswers;
import com.example.student.domain.Dto.AnswerSubmitDTO;
import com.example.common.domain.vo.PageWithAnswer;
import com.example.common.domain.vo.QuestionWithAnswerVO;

import java.util.List;

public interface StudentAnswersService extends IService<StudentAnswers> {

    /**
     * 批量保存或更新
     *
     * @param studentId
     * @param homeworkId
     * @param answerItems
     */
    void batchSaveOrUpdate(String studentId, String homeworkId,
                           List<AnswerSubmitDTO.AnswerItem> answerItems);


    /**
     * 获取作业的题目及答案
     *
     * @param questionPage
     * @param homeworkId
     * @param studentId
     * @return
     */
    PageWithAnswer<QuestionWithAnswerVO> getHomeworkWithAnswers(
            PageWithAnswer<QuestionWithAnswerVO> questionPage, String homeworkId, String studentId);

}
